﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>修改密码</title>
    <link rel="shortcut icon" href="favicon.ico">
	<link href="css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="css/style.min.css?v=4.0.0" rel="stylesheet">
	<style>
		.dl-horizontal {width: 300px;margin: 0 auto;}
		.dl-horizontal dt{width:80px;padding-bottom:20px;line-height:30px;}
		.dl-horizontal dd{margin-left:85px;}
	</style>
</head>

<body>
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox-content">

				<form id="argForm" class="form-horizontal m-t">
				<div class="col-sm-12">
					<dl class="dl-horizontal">
						<dt>原始密码：</dt>
						<dd>
							<div class="input-group input-group-sm ">
								<input name="oldPassword" type="password" class="form-control" >
							</div>
						</dd>
						<dt>新密码：</dt>
						<dd>
							<div class="input-group input-group-sm ">
								<input name="newPassword" type="password" class="form-control" >
							</div>
						</dd>
						<dt>确认新密码：</dt>
						<dd>
							<div class="input-group input-group-sm ">
								<input name="confirmPassword" type="password" class="form-control" >
							</div>
						</dd>

					</dl>
				</div>
				</form>
			</div>
		</div>
	</div>
	<div class="col-sm-2 col-sm-offset-5">
		<button onclick="updateMyPassword()" class="btn btn-w-m btn-success">确认修改</button>
	</div>
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.5"></script>
    <script src="js/content.min.js?v=1.0.0"></script>
	<script src="js/plugins/toastr/toastr.min.js"></script>
    <script type="text/javascript" src="js/custom/app.js" charset="UTF-8"></script>
    <script type="text/javascript" src="js/custom/tools.js" charset="UTF-8"></script>
	<script>


	function updateMyPassword(){
		var formData = new FormData($("form#argForm")[0]);
		var url = 'sysUser/updateMyPassword';
		jQuery.ajax({
			url:domain + url,
			type:"post",
			data:JSON.stringify(formData2JsonStr(formData)),
			contentType:"application/json;charset=utf-8",
			crossDomain:true,
			xhrFields:{
				withCredentials:true
			},
			success:function (data) {
				if(data.status == 200){
					top.toastr.success(data.msg);
				}else{
					top.toastr.warning(data.msg);
				}
			},
			error:function(data) {
				top.toastr.error("操作失败，请检查网络");
			}
		})
	}
	</script>
</body>

</html>
